<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <script src="/bootstrap/jquery-1.9.1.min.js"></script>
    <link rel="stylesheet" href="${ctx}/css/index_work.css">
</head>
<body>
<form>
    <input type="hidden" name="did" value="${getid.did}"><br>
    店铺名称:<input type="text" name="dname" value="${getid.dname}"><br>
    创建日期:<input type="date" name="create_date" value="${getid.create_date}"><br>
    图片:<input type="file" name="file" value="${getid.img}"><br>
    <input type="button" value="添加" onclick="add()">
</form>
</body>
<script>
    function add() {
        $.post("${ctx}/save.do",$("form").serialize(),function (data) {
            if(data){
                alert("添加成功");
                location.href="${ctx}/list.do"
            }else{
                alert("添加失败");
            }
        })
    }
</script>
</html>
